package com.huitone.gddw.utils;

import org.apache.commons.codec.binary.Base64;

/**
 * base64 工具类
 * @author wuluodan
 *
 */
public class Base64Utils {

	/** 
     * 加密
     * @param s 
     * @return String
     */  
    public static String encode(String s) {
        String result = "";  
        if (s != null) {
        	result = new String(Base64.encodeBase64String(s.getBytes()));
        }
    	return result;
    }
	
	/** 
	 * 解密
     * @param s 
     * @return String
     */  
    public static String decode(String s) {  
    	String result = "";  
        if (s != null) {
        	result = new String(Base64.decodeBase64(s));
        }
    	return result; 
    }
	
}
